home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / misc / toolboxsas.lha / Toolbox / lib / rex / Source.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-15  |  634 b   |  28 lines

  1. /* $Id: Source.c,v 2.4 1992/08/07 15:29:41 grosch rel $ */
  2.  
  3. $@ # include "$Source.h"
  4.  
  5. # include "System.h"
  6.  
  7. $@ int $_BeginSource(char * FileName)
  8. {
  9.    return OpenInput (FileName);
  10. }
  11.  
  12. $@ int $_GetLine(int File, char * Buffer, int Size)
  13. {
  14.    register int n = Read (File, Buffer, Size);
  15. # ifdef Dialog
  16. # define IgnoreChar ' '
  17.    /* Add dummy after newline character in order to supply a lookahead for rex. */
  18.    /* This way newline tokens are recognized without typing an extra line.      */
  19.    if (n > 0 && Buffer [n - 1] == '\n') Buffer [n ++] = IgnoreChar;
  20. # endif
  21.    return n;
  22. }
  23.  
  24. $@ void $_CloseSource(int File)
  25. {
  26.    Close (File);
  27. }
  28.